home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tegl6b.zip / INTROPAK.EXE / lha / EXEVENT1.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-04  |  2KB  |  89 lines

  1. {$F+}  { -- far code model is required for any functions that }
  2.        { -- are to be used as Event Handlers }
  3.  
  4. Uses
  5.     dos,
  6.     tgraph,
  7.  
  8.     virtmem,
  9.     teglfont,
  10.     fastgrph,
  11.     TEGLIntr,
  12.     TEGLICON,
  13.     TEGLUnit,
  14.     TEGLMain,
  15.     TEGLMenu,
  16.     SenseMs,
  17.     DebugUnt;
  18.  
  19.  
  20.  
  21. VAR
  22.   om1, om2 : OptionMPtr;
  23.  
  24.  
  25.  
  26. FUNCTION GetMsSense(FS:imagestkptr; Ms: msclickptr) : WORD;
  27.   BEGIN
  28.     SetMouseSense(fs^.x,fs^.y);
  29.     GetMsSense := 1;
  30.   END;
  31.  
  32. {-- This event will open up a frame and display a message. Then }
  33. {-- it returns leaving the frame displayed. Since no event has }
  34. {-- been defined to close this frame then it will stay up, there }
  35. {-- is no way to get rid of it. }
  36.  
  37. FUNCTION InfoOption(FS:imagestkptr; Ms: MsClickPtr) : WORD;
  38.    VAR
  39.       x,y,x1,y1  : WORD;
  40.       IFS         : ImageStkPtr;
  41.    BEGIN
  42.       Hidemouse;
  43.  
  44.       x  := 200;
  45.       y  := 120;
  46.       x1 := x+340;
  47.       y1 := y+100;
  48.  
  49.       PushImage(x,y,x1,y1);
  50.       IFS := StackPtr;
  51.  
  52.       SetColor(White);
  53.       ShadowBox(x,y,x1,y1);
  54.       SetColor(Black);
  55.       OutTEGLtextxy(x+5,y+5,'TEGL Windows Toolkit II');
  56.       OutTEGLtextxy(x+5,y+5+TEGLCharHeight,
  57.       'Jan 1,1990, Program Written by Richard Tom');
  58.  
  59.       ShowMouse;
  60.  
  61.       InfoOption := 1;
  62.    END;
  63.  
  64.  
  65.  
  66. BEGIN
  67.  
  68.    EasyTEGL;
  69.  
  70.  
  71.    om1 := CreateOptionMenu(@Font14);
  72.    DefineOptions(om1,' ~O~pen ', true, NilUnitProc);
  73.    DefineOptions(om1,' ~I~nfo...',true, InfoOption);
  74.    DefineOptions(om1,'-',     false,NilUnitProc);
  75.    DefineOptions(om1,' ~Q~uit ', true, Quit);
  76.  
  77.    om2 := CreateOptionMenu(@Font14);
  78.    DefineOptions(om2,' ~M~emory ',true,ShowCoordinates);
  79.    DefineOptions(om2,' ~M~ouse Sensitivity ',true,GetMsSense);
  80.  
  81.    CreateBarMenu(0,0,getmaxx);
  82.    OutBarOption(' ~F~ile ',om1);
  83.    OutBarOption(' ~U~tility ',om2);
  84.  
  85.    { -- control is then passed to the supervisor }
  86.  
  87.    TEGLSupervisor;
  88. END.
  89.